<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div {
            height: 100vh;
            background: red;
        }
    </style>
</head>

<body>
    <div id="test">

    </div>
    <!-- <script>

        function debounce(fn, delay = 300, i) {
            let timer;
            const context = this;
            return function() {
                //console.log(arguments) //事件源
                const arg = arguments;
                if (timer) clearTimeout(timer);
                timer = setTimeout(() => {
                    timer = null;
                    fn();
                }, delay)
            }
        }

        // 参数是 请求的参数 返回值为axios请求函数
        function count(par = {}) {
            const par1 = par
            return function() {
                // 这里放axios请求 
                console.log(par1)
            }

        }
        const context = document.getElementById('test');
        context.onmousemove = debounce(count({
            name: 'xxx'
        }), 300);
    </script> -->
</body>

</html>